<?php

namespace Contacts\Model;

use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;


class Person implements InputFilterAwareInterface
{
	public $id;
	public $department;
	public $firstname;
	public $jobtitle;
	public $lastname;
	public $mobilephone;
	public $officephone;
	public $officefax;
	public $ownedsecurableitem_id;
	public $primaryaddress_address_id;
	public $primaryemail_email_id;
	public $title_customfield_id;
	protected $inputFilter;

	public function exchangeArray($data)
	{
		$this->id     = (isset($data['id'])) ? $data['id'] : null;
		$this->department = (isset($data['department'])) ? $data['department'] : null;
		$this->firstname  = (isset($data['firstname'])) ? $data['firstname'] : null;
		$this->jobtitle     = (isset($data['jobtitle'])) ? $data['jobtitle'] : null;
		$this->lastname = (isset($data['lastname'])) ? $data['lastname'] : null;
		$this->mobilephone  = (isset($data['mobilephone'])) ? $data['mobilephone'] : null;
		$this->officephone     = (isset($data['officephone'])) ? $data['officephone'] : null;
		$this->officefax = (isset($data['officefax'])) ? $data['officefax'] : null;
		$this->ownedsecurableitem_id  = (isset($data['ownedsecurableitem_id'])) ? $data['ownedsecurableitem_id'] : null;
		$this->primaryaddress_address_id     = (isset($data['primaryaddress_address_id'])) ? $data['primaryaddress_address_id'] : null;
		$this->primaryemail_email_id = (isset($data['primaryemail_email_id'])) ? $data['primaryemail_email_id'] : null;
		$this->title_customfield_id  = (isset($data['title_customfield_id'])) ? $data['title_customfield_id'] : null;
	}
	
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}
	
	
	public function setInputFilter(InputFilterInterface $inputFilter)
	{
		throw new \Exception("Not used");
	}
	
	public function getInputFilter()
	{
		if (!$this->inputFilter) {
			$inputFilter = new InputFilter();
	
			$inputFilter->add(array(
					'name'     => 'id',
					'filters'  => array(
							array('name' => 'Int'),
					),
			));
	
			$inputFilter->add(array(
					'name'     => 'department',
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			));
	
			$inputFilter->add(array(
					'name'     => 'firstname',
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			));
			
			$inputFilter->add(array(
					'name'     => 'jobtitle',
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			));
			
			$inputFilter->add(array(
					'name'     => 'lastname',
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			));
			
			$inputFilter->add(array(
					'name'     => 'mobilephone',
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			));
			
			$inputFilter->add(array(
					'name'     => 'officephone',
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			));
			
			$inputFilter->add(array(
					'name'     => 'officefax',
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					
			));
			
			$inputFilter->add(array(
					'name'     => 'ownedsecurableitem_id',
					'filters'  => array(
							array('name' => 'Int'),
					),
			));
			
			$inputFilter->add(array(
					'name'     => 'primaryaddress_address_id',
					'filters'  => array(
							array('name' => 'Int'),
					),
			));
			
			$inputFilter->add(array(
					'name'     => 'primaryemail_email_id',
					'filters'  => array(
							array('name' => 'Int'),
					),
			));
			
			$inputFilter->add(array(
					'name'     => 'title_customfield_id',
					'filters'  => array(
							array('name' => 'Int'),
					),
			));
	
			$this->inputFilter = $inputFilter;
		}
	
		return $this->inputFilter;
	}
	
}